<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>EquTemper: ETI_CplxTxt.cc Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="$relpath<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="$relpath<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>/search.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<div id="top"><!-- do not remove this div! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">EquTemper&#160;<span id="projectnumber">1.01</span></div>
   <div id="projectbrief">An equation editor.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<script type="text/javascript">
function hasClass(ele,cls) {
  return ele.className.match(new RegExp('(\\s|^)'+cls+'(\\s|$)'));
}

function addClass(ele,cls) {
  if (!this.hasClass(ele,cls)) ele.className += " "+cls;
}

function removeClass(ele,cls) {
  if (hasClass(ele,cls)) {
    var reg = new RegExp('(\\s|^)'+cls+'(\\s|$)');
    ele.className=ele.className.replace(reg,' ');
  }
}

function toggleVisibility(linkObj) {
 var base = linkObj.getAttribute('id');
 var summary = document.getElementById(base + '-summary');
 var content = document.getElementById(base + '-content');
 var trigger = document.getElementById(base + '-trigger');
 if ( hasClass(linkObj,'closed') ) {
   summary.style.display = 'none';
   content.style.display = 'block';
   trigger.src = 'open.png';
   removeClass(linkObj,'closed');
   addClass(linkObj,'opened');
 } else if ( hasClass(linkObj,'opened') ) {
   summary.style.display = 'block';
   content.style.display = 'none';
   trigger.src = 'closed.png';
   removeClass(linkObj,'opened');
   addClass(linkObj,'closed');
 }
 return false;
}
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
      <li id="searchli">
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('_e_t_i___cplx_txt_8cc.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">ETI_CplxTxt.cc</div>  </div>
</div>
<div class="contents">
<a href="_e_t_i___cplx_txt_8cc.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* ========================================================================= */</span>
<a name="l00002"></a>00002 <span class="comment">/* ------------------------------------------------------------------------- */</span><span class="comment"></span>
<a name="l00003"></a>00003 <span class="comment">/*!</span>
<a name="l00004"></a>00004 <span class="comment">\file           ETI_CplxTxt.cc</span>
<a name="l00005"></a>00005 <span class="comment">\date           september 2011</span>
<a name="l00006"></a>00006 <span class="comment">\author     TNick</span>
<a name="l00007"></a>00007 <span class="comment"></span>
<a name="l00008"></a>00008 <span class="comment">\brief      Contains the implementation for ETI_CplxTxt class</span>
<a name="l00009"></a>00009 <span class="comment"></span>
<a name="l00010"></a>00010 <span class="comment"></span>
<a name="l00011"></a>00011 <span class="comment">Copyright (c) 2011, Nicu Tofan</span>
<a name="l00012"></a>00012 <span class="comment">All rights reserved.</span>
<a name="l00013"></a>00013 <span class="comment"></span>
<a name="l00014"></a>00014 <span class="comment">Redistribution and use in source and binary forms, with or without</span>
<a name="l00015"></a>00015 <span class="comment">modification, are permitted provided that the following conditions are met:</span>
<a name="l00016"></a>00016 <span class="comment">* Redistributions of source code must retain the above copyright</span>
<a name="l00017"></a>00017 <span class="comment">notice, this list of conditions and the following disclaimer.</span>
<a name="l00018"></a>00018 <span class="comment">* Redistributions in binary form must reproduce the above copyright</span>
<a name="l00019"></a>00019 <span class="comment">notice, this list of conditions and the following disclaimer in the</span>
<a name="l00020"></a>00020 <span class="comment">documentation and/or other materials provided with the distribution.</span>
<a name="l00021"></a>00021 <span class="comment">* Neither the name of the copyright holder nor the</span>
<a name="l00022"></a>00022 <span class="comment">names of its contributors may be used to endorse or promote products</span>
<a name="l00023"></a>00023 <span class="comment">derived from this software without specific prior written permission.</span>
<a name="l00024"></a>00024 <span class="comment"></span>
<a name="l00025"></a>00025 <span class="comment">THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS &quot;AS IS&quot; AND</span>
<a name="l00026"></a>00026 <span class="comment">ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED</span>
<a name="l00027"></a>00027 <span class="comment">WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE</span>
<a name="l00028"></a>00028 <span class="comment">DISCLAIMED. IN NO EVENT SHALL NICU TOFAN BE LIABLE FOR ANY</span>
<a name="l00029"></a>00029 <span class="comment">DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES</span>
<a name="l00030"></a>00030 <span class="comment">(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;</span>
<a name="l00031"></a>00031 <span class="comment">LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND</span>
<a name="l00032"></a>00032 <span class="comment">ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT</span>
<a name="l00033"></a>00033 <span class="comment">(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS</span>
<a name="l00034"></a>00034 <span class="comment">SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span>
<a name="l00035"></a>00035 <span class="comment"></span>
<a name="l00036"></a>00036 <span class="comment">*/</span>
<a name="l00037"></a>00037 <span class="comment">/* ------------------------------------------------------------------------- */</span>
<a name="l00038"></a>00038 <span class="comment">/* ========================================================================= */</span>
<a name="l00039"></a>00039 <span class="comment">//</span>
<a name="l00040"></a>00040 <span class="comment">//</span>
<a name="l00041"></a>00041 <span class="comment">//</span>
<a name="l00042"></a>00042 <span class="comment">//</span>
<a name="l00043"></a>00043 <span class="comment">/*  INCLUDES    ------------------------------------------------------------ */</span>
<a name="l00044"></a>00044 
<a name="l00045"></a>00045 <span class="preprocessor">#include    &lt;<a class="code" href="main_8h.html" title="Contains global definitions for application.">main.h</a>&gt;</span>
<a name="l00046"></a>00046 
<a name="l00047"></a>00047 <span class="preprocessor">#include    &lt;QDebug&gt;</span>
<a name="l00048"></a>00048 <span class="preprocessor">#include    &lt;QRect&gt;</span>
<a name="l00049"></a>00049 <span class="preprocessor">#include    &lt;QStyleOptionGraphicsItem&gt;</span>
<a name="l00050"></a>00050 <span class="preprocessor">#include    &lt;QGraphicsScene&gt;</span>
<a name="l00051"></a>00051 <span class="preprocessor">#include    &lt;QGraphicsSceneMouseEvent&gt;</span>
<a name="l00052"></a>00052 <span class="preprocessor">#include    &lt;QEvent&gt;</span>
<a name="l00053"></a>00053 <span class="preprocessor">#include    &lt;QKeyEvent&gt;</span>
<a name="l00054"></a>00054 <span class="preprocessor">#include    &lt;QApplication&gt;</span>
<a name="l00055"></a>00055 <span class="preprocessor">#include    &lt;QInputContext&gt;</span>
<a name="l00056"></a>00056 <span class="preprocessor">#include    &lt;QPainter&gt;</span>
<a name="l00057"></a>00057 
<a name="l00058"></a>00058 <span class="preprocessor">#include    &lt;<a class="code" href="_e_t_sheet_8h.html" title="Contains the definition for ETSheet class.">sheet/ETSheet.h</a>&gt;</span>
<a name="l00059"></a>00059 <span class="preprocessor">#include    &lt;<a class="code" href="_e_t_sheet_view_8h.html" title="Contains the definition for ETSheetView class.">sheet/ETSheetView.h</a>&gt;</span>
<a name="l00060"></a>00060 <span class="preprocessor">#include    &lt;<a class="code" href="_e_t_sub_item_8h.html" title="Contains the definition for ETSubItem class.">sheet/ETSubItem.h</a>&gt;</span>
<a name="l00061"></a>00061 
<a name="l00062"></a>00062 <span class="preprocessor">#include    &lt;<a class="code" href="_e_t_s_i___fract_8h.html" title="Contains the definition for ETSI_Fract class.">sheet/subitems/ETSI_Fract.h</a>&gt;</span>
<a name="l00063"></a>00063 <span class="preprocessor">#include    &lt;<a class="code" href="_e_t_s_i___h_text_8h.html" title="Contains the definition for ETSI_HText class.">sheet/subitems/ETSI_HText.h</a>&gt;</span>
<a name="l00064"></a>00064 <span class="preprocessor">#include    &lt;<a class="code" href="_e_t_s_i___integ_8h.html" title="Contains the definition for ETSI_Integ class.">sheet/subitems/ETSI_Integ.h</a>&gt;</span>
<a name="l00065"></a>00065 <span class="preprocessor">#include    &lt;<a class="code" href="_e_t_s_i___lim_8h.html" title="Contains the definition for ETSI_Lim class.">sheet/subitems/ETSI_Lim.h</a>&gt;</span>
<a name="l00066"></a>00066 <span class="preprocessor">#include    &lt;<a class="code" href="_e_t_s_i___logic_ac_8h.html" title="Contains the definition for ETSI_LogicAc class.">sheet/subitems/ETSI_LogicAc.h</a>&gt;</span>
<a name="l00067"></a>00067 <span class="preprocessor">#include    &lt;<a class="code" href="_e_t_s_i___matrix_8h.html" title="Contains the definition for ETSI_Matrix class.">sheet/subitems/ETSI_Matrix.h</a>&gt;</span>
<a name="l00068"></a>00068 <span class="preprocessor">#include    &lt;<a class="code" href="_e_t_s_i___radic_8h.html" title="Contains the definition for ETSI_Radic class.">sheet/subitems/ETSI_Radic.h</a>&gt;</span>
<a name="l00069"></a>00069 <span class="preprocessor">#include    &lt;<a class="code" href="_e_t_s_i___s_text_8h.html" title="Contains the definition for ETSI_SText class.">sheet/subitems/ETSI_SText.h</a>&gt;</span>
<a name="l00070"></a>00070 <span class="preprocessor">#include    &lt;<a class="code" href="_e_t_s_i___sum_8h.html" title="Contains the definition for ETSI_Sum class.">sheet/subitems/ETSI_Sum.h</a>&gt;</span>
<a name="l00071"></a>00071 
<a name="l00072"></a>00072 
<a name="l00073"></a>00073 
<a name="l00074"></a>00074 <span class="preprocessor">#include    &lt;<a class="code" href="_e_t_vp_cmd___edit_sub_i_8h.html" title="Contains the definition for ETVpCmd_EditSubI class.">sheet/vp_cmd/ETVpCmd_EditSubI.h</a>&gt;</span>
<a name="l00075"></a>00075 
<a name="l00076"></a>00076 <span class="preprocessor">#include    &quot;<a class="code" href="_e_t_i___cplx_txt_8h.html" title="Contains the definition for ETI_CplxTxt class.">ETI_CplxTxt.h</a>&quot;</span>
<a name="l00077"></a>00077 
<a name="l00078"></a>00078 <span class="comment">/*  INCLUDES    ============================================================ */</span>
<a name="l00079"></a>00079 <span class="comment">//</span>
<a name="l00080"></a>00080 <span class="comment">//</span>
<a name="l00081"></a>00081 <span class="comment">//</span>
<a name="l00082"></a>00082 <span class="comment">//</span>
<a name="l00083"></a>00083 <span class="comment">/*  CLASS    --------------------------------------------------------------- */</span>
<a name="l00084"></a>00084 <a class="code" href="ddhc__main_8h.html#abeddf5a2c22a7727d1c96c148d05d9cf">DDHC_CONTENT</a>(<a class="code" href="class_e_t_i___cplx_txt.html" title="class representing a complex text; this may or may not represent an equation">ETI_CplxTxt</a>)
<a name="l00085"></a>00085 
<a name="l00086"></a>00086 
<a name="l00087"></a>00087 <span class="comment">/* ------------------------------------------------------------------------- */</span>
<a name="l00088"></a><a class="code" href="class_e_t_i___cplx_txt.html#a7723a43d0881fe207599aee3e0241f9a">00088</a> void            <a class="code" href="class_e_t_i___cplx_txt.html" title="class representing a complex text; this may or may not represent an equation">ETI_CplxTxt</a>::init       ( <span class="keywordtype">void</span> )
<a name="l00089"></a>00089 {
<a name="l00090"></a>00090     setFlags(ItemIsMovable | ItemIsSelectable | ItemIsFocusable);
<a name="l00091"></a>00091 
<a name="l00092"></a>00092     <span class="comment">/* initialise the embedded root item */</span>
<a name="l00093"></a>00093     it_r.setFather(<span class="keyword">this</span>);
<a name="l00094"></a>00094 <span class="preprocessor">#ifdef APP_DEBUG</span>
<a name="l00095"></a>00095 <span class="preprocessor"></span>    it_r.setColor(QColor(Qt::white));
<a name="l00096"></a>00096     it_r.setPen(qRgb(100,200,0));
<a name="l00097"></a>00097 <span class="preprocessor">#else</span>
<a name="l00098"></a>00098 <span class="preprocessor"></span>    it_r.setColor(QColor(Qt::white));
<a name="l00099"></a>00099     it_r.setPen(0); <span class="comment">/* black */</span>
<a name="l00100"></a>00100 <span class="preprocessor">#endif</span>
<a name="l00101"></a>00101 <span class="preprocessor"></span>
<a name="l00102"></a>00102     <a class="code" href="ddhc__main_8h.html#a5450dfe3c644f059533fb6b0a704d9bf">DDHC_CONSTRUCT</a>;
<a name="l00103"></a>00103 
<a name="l00104"></a>00104 }
<a name="l00105"></a>00105 <span class="comment">/* ========================================================================= */</span>
<a name="l00106"></a>00106 
<a name="l00107"></a>00107 <span class="comment">/* ------------------------------------------------------------------------- */</span>
<a name="l00108"></a><a class="code" href="class_e_t_i___cplx_txt.html#aebbd17a8b2444b1a4a29c422a1fa85ad">00108</a> <a class="code" href="class_e_t_i___cplx_txt.html#aebbd17a8b2444b1a4a29c422a1fa85ad" title="internal constructor used by loadXML() to create the new instance">ETI_CplxTxt::ETI_CplxTxt</a>    ()
<a name="l00109"></a>00109     : QGraphicsItem (<a class="code" href="aclass__ddhc_8cc.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>)
<a name="l00110"></a>00110 {
<a name="l00111"></a>00111 
<a name="l00112"></a>00112     <a class="code" href="class_e_t_i___cplx_txt.html#a7723a43d0881fe207599aee3e0241f9a" title="internal function that is used by constructors to make basic initialisation">init</a>();
<a name="l00113"></a>00113 
<a name="l00114"></a>00114 }
<a name="l00115"></a>00115 <span class="comment">/* ========================================================================= */</span>
<a name="l00116"></a>00116 
<a name="l00117"></a>00117 <span class="comment">/* ------------------------------------------------------------------------- */</span>
<a name="l00118"></a><a class="code" href="class_e_t_i___cplx_txt.html#acf335b224bbef5abd81c1d6b9caab5bc">00118</a> <a class="code" href="class_e_t_i___cplx_txt.html#aebbd17a8b2444b1a4a29c422a1fa85ad" title="internal constructor used by loadXML() to create the new instance">ETI_CplxTxt::ETI_CplxTxt</a>    (
<a name="l00119"></a>00119         <a class="code" href="class_e_t_sheet.html" title="Class representing logical root for all elements contained in a document (sheet)">ETSheet</a> * sht, qreal loc_x, qreal loc_y)
<a name="l00120"></a>00120     : QGraphicsItem (<a class="code" href="aclass__ddhc_8cc.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>)
<a name="l00121"></a>00121 {
<a name="l00122"></a>00122 
<a name="l00123"></a>00123     <a class="code" href="class_e_t_i___cplx_txt.html#a7723a43d0881fe207599aee3e0241f9a" title="internal function that is used by constructors to make basic initialisation">init</a>();
<a name="l00124"></a>00124 
<a name="l00125"></a>00125     <span class="comment">/* create a new, simple text */</span>
<a name="l00126"></a>00126     setPos(loc_x, loc_y);
<a name="l00127"></a>00127     <a class="code" href="class_e_t_s_i___s_text.html" title="simple sub-item capable to display a string">ETSI_SText</a> * only_it;
<a name="l00128"></a>00128 <span class="preprocessor">#ifdef APP_DEBUG</span>
<a name="l00129"></a>00129 <span class="preprocessor"></span>    <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; 1; i++)
<a name="l00130"></a>00130     {
<a name="l00131"></a>00131         only_it = <span class="keyword">new</span> <a class="code" href="class_e_t_s_i___s_text.html" title="simple sub-item capable to display a string">ETSI_SText</a>();
<a name="l00132"></a>00132         <a class="code" href="class_e_t_i___cplx_txt.html#af79d9753f43d28e05915c1bf193f572a" title="the root item">it_r</a>.<a class="code" href="class_e_t_s_i___root.html#a0a62cd333fa4d577087d3dbe144eba6a" title="append an item (insert after last)">append</a>(only_it);
<a name="l00133"></a>00133     }
<a name="l00134"></a>00134     only_it-&gt;<a class="code" href="class_e_t_sub_item.html#a47c036ee19c7e4557588f11d43c940fe" title="set default color">setColor</a>(Qt::red);
<a name="l00135"></a>00135     only_it-&gt;<a class="code" href="class_e_t_sub_item.html#ad67d15830b8bf3c09c838cefe39fac59" title="set default color">setPen</a>(qRgb(255,255,255));
<a name="l00136"></a>00136 
<a name="l00137"></a>00137     <a class="code" href="class_e_t_s_i___fract.html" title="sub-item displaying a fraction; consists of two ETSI_Root sub-items">ETSI_Fract</a> * fract_1 = <span class="keyword">new</span> <a class="code" href="class_e_t_s_i___fract.html" title="sub-item displaying a fraction; consists of two ETSI_Root sub-items">ETSI_Fract</a>();
<a name="l00138"></a>00138     <a class="code" href="class_e_t_i___cplx_txt.html#af79d9753f43d28e05915c1bf193f572a" title="the root item">it_r</a>.<a class="code" href="class_e_t_s_i___root.html#a0a62cd333fa4d577087d3dbe144eba6a" title="append an item (insert after last)">append</a>(fract_1);
<a name="l00139"></a>00139     <span class="comment">//ETSI_HText * htx_1 = new ETSI_HText();</span>
<a name="l00140"></a>00140     <span class="comment">//it_r.append(htx_1);</span>
<a name="l00141"></a>00141     <a class="code" href="class_e_t_s_i___integ.html" title="sub-item presenting an integral; consists of four ETSI_Root sub-items">ETSI_Integ</a> * intg_1 = <span class="keyword">new</span> <a class="code" href="class_e_t_s_i___integ.html" title="sub-item presenting an integral; consists of four ETSI_Root sub-items">ETSI_Integ</a>();
<a name="l00142"></a>00142     <a class="code" href="class_e_t_i___cplx_txt.html#af79d9753f43d28e05915c1bf193f572a" title="the root item">it_r</a>.<a class="code" href="class_e_t_s_i___root.html#a0a62cd333fa4d577087d3dbe144eba6a" title="append an item (insert after last)">append</a>(intg_1);
<a name="l00143"></a>00143     <a class="code" href="class_e_t_s_i___lim.html" title="sub-item presenting a limit">ETSI_Lim</a> * lim_1 = <span class="keyword">new</span> <a class="code" href="class_e_t_s_i___lim.html" title="sub-item presenting a limit">ETSI_Lim</a>();
<a name="l00144"></a>00144     <a class="code" href="class_e_t_i___cplx_txt.html#af79d9753f43d28e05915c1bf193f572a" title="the root item">it_r</a>.<a class="code" href="class_e_t_s_i___root.html#a0a62cd333fa4d577087d3dbe144eba6a" title="append an item (insert after last)">append</a>(lim_1);
<a name="l00145"></a>00145     <a class="code" href="class_e_t_s_i___logic_ac.html" title="sub-item able to display a logical if-elseif-else component">ETSI_LogicAc</a> * la_1 = <span class="keyword">new</span> <a class="code" href="class_e_t_s_i___logic_ac.html" title="sub-item able to display a logical if-elseif-else component">ETSI_LogicAc</a>();
<a name="l00146"></a>00146     <a class="code" href="class_e_t_i___cplx_txt.html#af79d9753f43d28e05915c1bf193f572a" title="the root item">it_r</a>.<a class="code" href="class_e_t_s_i___root.html#a0a62cd333fa4d577087d3dbe144eba6a" title="append an item (insert after last)">append</a>(la_1);
<a name="l00147"></a>00147     <a class="code" href="class_e_t_s_i___matrix.html" title="sub-item presenting a matrix or a determinant">ETSI_Matrix</a> * matr_1 = <span class="keyword">new</span> <a class="code" href="class_e_t_s_i___matrix.html" title="sub-item presenting a matrix or a determinant">ETSI_Matrix</a>();
<a name="l00148"></a>00148     <a class="code" href="class_e_t_i___cplx_txt.html#af79d9753f43d28e05915c1bf193f572a" title="the root item">it_r</a>.<a class="code" href="class_e_t_s_i___root.html#a0a62cd333fa4d577087d3dbe144eba6a" title="append an item (insert after last)">append</a>(matr_1);
<a name="l00149"></a>00149     <a class="code" href="class_e_t_s_i___radic.html" title="sub-item that will display a radical">ETSI_Radic</a> * radic_1 = <span class="keyword">new</span> <a class="code" href="class_e_t_s_i___radic.html" title="sub-item that will display a radical">ETSI_Radic</a>();
<a name="l00150"></a>00150     <a class="code" href="class_e_t_i___cplx_txt.html#af79d9753f43d28e05915c1bf193f572a" title="the root item">it_r</a>.<a class="code" href="class_e_t_s_i___root.html#a0a62cd333fa4d577087d3dbe144eba6a" title="append an item (insert after last)">append</a>(radic_1);
<a name="l00151"></a>00151     <a class="code" href="class_e_t_s_i___s_text.html" title="simple sub-item capable to display a string">ETSI_SText</a> * stx_1 = <span class="keyword">new</span> <a class="code" href="class_e_t_s_i___s_text.html" title="simple sub-item capable to display a string">ETSI_SText</a>();
<a name="l00152"></a>00152     <a class="code" href="class_e_t_i___cplx_txt.html#af79d9753f43d28e05915c1bf193f572a" title="the root item">it_r</a>.<a class="code" href="class_e_t_s_i___root.html#a0a62cd333fa4d577087d3dbe144eba6a" title="append an item (insert after last)">append</a>(stx_1);
<a name="l00153"></a>00153     <a class="code" href="class_e_t_s_i___sum.html" title="sub-item that will display a sum; consists of three ETSI_Root sub-items">ETSI_Sum</a> * sum_1 = <span class="keyword">new</span> <a class="code" href="class_e_t_s_i___sum.html" title="sub-item that will display a sum; consists of three ETSI_Root sub-items">ETSI_Sum</a>();
<a name="l00154"></a>00154     <a class="code" href="class_e_t_i___cplx_txt.html#af79d9753f43d28e05915c1bf193f572a" title="the root item">it_r</a>.<a class="code" href="class_e_t_s_i___root.html#a0a62cd333fa4d577087d3dbe144eba6a" title="append an item (insert after last)">append</a>(sum_1);
<a name="l00155"></a>00155     <a class="code" href="class_e_t_s_i___rows.html" title="sub-item able to display any number of rows, each of wich with multiple sub-items">ETSI_Rows</a> * rows_1 = <span class="keyword">new</span> <a class="code" href="class_e_t_s_i___rows.html" title="sub-item able to display any number of rows, each of wich with multiple sub-items">ETSI_Rows</a>();
<a name="l00156"></a>00156     <a class="code" href="class_e_t_i___cplx_txt.html#af79d9753f43d28e05915c1bf193f572a" title="the root item">it_r</a>.<a class="code" href="class_e_t_s_i___root.html#a0a62cd333fa4d577087d3dbe144eba6a" title="append an item (insert after last)">append</a>(rows_1);
<a name="l00157"></a>00157 
<a name="l00158"></a>00158 
<a name="l00159"></a>00159 <span class="preprocessor">#else</span>
<a name="l00160"></a>00160 <span class="preprocessor"></span>    only_it = <span class="keyword">new</span> <a class="code" href="class_e_t_s_i___s_text.html" title="simple sub-item capable to display a string">ETSI_SText</a>();
<a name="l00161"></a>00161     <a class="code" href="class_e_t_i___cplx_txt.html#af79d9753f43d28e05915c1bf193f572a" title="the root item">it_r</a>.<a class="code" href="class_e_t_s_i___root.html#a0a62cd333fa4d577087d3dbe144eba6a" title="append an item (insert after last)">append</a>(only_it);
<a name="l00162"></a>00162     <span class="comment">/* inherits the colors from it&#39;s father */</span>
<a name="l00163"></a>00163 <span class="preprocessor">#endif</span>
<a name="l00164"></a>00164 <span class="preprocessor"></span>
<a name="l00165"></a>00165 
<a name="l00166"></a>00166     <a class="code" href="class_e_t_i___cplx_txt.html#a7766fe534a3545eae5855d0d1322291a" title="recompute internal data">recompute</a>(<span class="keyword">true</span>);
<a name="l00167"></a>00167 
<a name="l00168"></a>00168     sht-&gt;addItem(<span class="keyword">this</span>);
<a name="l00169"></a>00169     <a class="code" href="ddhc__main_8h.html#a86ac382665d71d5977e4620723ae78f5">DDHC_REPARENT</a>(sht);
<a name="l00170"></a>00170 
<a name="l00171"></a>00171 }
<a name="l00172"></a>00172 <span class="comment">/* ========================================================================= */</span>
<a name="l00173"></a>00173 
<a name="l00174"></a>00174 <span class="comment">/* ------------------------------------------------------------------------- */</span>
<a name="l00175"></a><a class="code" href="class_e_t_i___cplx_txt.html#ab191ee15844ec92d63adce064a60c2a3">00175</a> <a class="code" href="class_e_t_i___cplx_txt.html#ab191ee15844ec92d63adce064a60c2a3" title="destructor">ETI_CplxTxt::~ETI_CplxTxt</a>   ( <span class="keywordtype">void</span> )
<a name="l00176"></a>00176 {
<a name="l00177"></a>00177     <a class="code" href="ddhc__main_8h.html#a83b4d50889e49e105c89d71acff6f975">DDHC_DESTRUCT</a>
<a name="l00178"></a>00178 
<a name="l00179"></a>00179 }
<a name="l00180"></a>00180 <span class="comment">/* ========================================================================= */</span>
<a name="l00181"></a>00181 
<a name="l00182"></a>00182 <span class="comment">/* ------------------------------------------------------------------------- */</span>
<a name="l00183"></a><a class="code" href="class_e_t_i___cplx_txt.html#ae9b4ae9249ec73c2b570e601436ad44b">00183</a> QRectF          <a class="code" href="class_e_t_i___cplx_txt.html#ae9b4ae9249ec73c2b570e601436ad44b" title="defines the outer bounds of the item as a rectangle">ETI_CplxTxt::boundingRect</a>   ( <span class="keywordtype">void</span> )<span class="keyword"> const</span>
<a name="l00184"></a>00184 <span class="keyword"></span>{
<a name="l00185"></a>00185     qreal adj_f = <a class="code" href="class_e_t_i___cplx_txt.html#af79d9753f43d28e05915c1bf193f572a" title="the root item">it_r</a>.<a class="code" href="class_e_t_sub_item.html#adf58f56e8ceb21c5bdfce3effa09816b" title="the bounding box">boundingBox</a>().height() * 5 / 100;
<a name="l00186"></a>00186     <span class="keywordflow">return</span> <a class="code" href="class_e_t_i___cplx_txt.html#af79d9753f43d28e05915c1bf193f572a" title="the root item">it_r</a>.<a class="code" href="class_e_t_sub_item.html#adf58f56e8ceb21c5bdfce3effa09816b" title="the bounding box">boundingBox</a>().adjusted(-adj_f, -adj_f, adj_f, adj_f);
<a name="l00187"></a>00187 }
<a name="l00188"></a>00188 <span class="comment">/* ========================================================================= */</span>
<a name="l00189"></a>00189 
<a name="l00190"></a>00190 <span class="comment">/* ------------------------------------------------------------------------- */</span>
<a name="l00191"></a><a class="code" href="class_e_t_i___cplx_txt.html#a101efd55b8e5b12f4382cda353b818be">00191</a> <span class="keywordtype">void</span>            <a class="code" href="class_e_t_i___cplx_txt.html#a101efd55b8e5b12f4382cda353b818be" title="paints the contents of an item in local coordinates">ETI_CplxTxt::paint</a>                  (
<a name="l00192"></a>00192         QPainter *painter, <span class="keyword">const</span> QStyleOptionGraphicsItem *option,
<a name="l00193"></a>00193         QWidget *widget)
<a name="l00194"></a>00194 {
<a name="l00195"></a>00195     Q_UNUSED(option);
<a name="l00196"></a>00196     Q_UNUSED(widget);
<a name="l00197"></a>00197     Q_UNUSED(painter);
<a name="l00198"></a>00198 
<a name="l00199"></a>00199     <a class="code" href="class_e_t_sheet_view.html" title="Widget capable of displaying an ETSheet content.">ETSheetView</a> * vp = <span class="keyword">static_cast&lt;</span><a class="code" href="class_e_t_sheet_view.html" title="Widget capable of displaying an ETSheet content.">ETSheetView</a> *<span class="keyword">&gt;</span>(widget-&gt;parent());
<a name="l00200"></a>00200     painter-&gt;setPen(QPen(option-&gt;palette.windowText(), 0, Qt::SolidLine));
<a name="l00201"></a>00201 
<a name="l00202"></a>00202     <a class="code" href="class_e_t_i___cplx_txt.html#af79d9753f43d28e05915c1bf193f572a" title="the root item">it_r</a>.<a class="code" href="class_e_t_s_i___root.html#a16522fb210465b3af6eda3dd85ad6a23" title="paint the element on provided surface">paint</a>(vp, painter, QPointF(0, 0));
<a name="l00203"></a>00203     <span class="keywordflow">if</span> (option-&gt;state &amp; (
<a name="l00204"></a>00204                 QStyle::State_Selected | QStyle::State_HasFocus))
<a name="l00205"></a>00205     {
<a name="l00206"></a>00206         QRectF adj = <a class="code" href="class_e_t_i___cplx_txt.html#af79d9753f43d28e05915c1bf193f572a" title="the root item">it_r</a>.<a class="code" href="class_e_t_sub_item.html#adf58f56e8ceb21c5bdfce3effa09816b" title="the bounding box">boundingBox</a>();
<a name="l00207"></a>00207         qreal adj_f = <a class="code" href="class_e_t_i___cplx_txt.html#af79d9753f43d28e05915c1bf193f572a" title="the root item">it_r</a>.<a class="code" href="class_e_t_sub_item.html#adf58f56e8ceb21c5bdfce3effa09816b" title="the bounding box">boundingBox</a>().height() * 5 / 100;
<a name="l00208"></a>00208         adj.adjust(-adj_f,-adj_f,adj_f,adj_f);
<a name="l00209"></a>00209         painter-&gt;setPen(QPen(option-&gt;palette.windowText(), 0, Qt::DashLine));
<a name="l00210"></a>00210         painter-&gt;setBrush(Qt::NoBrush);
<a name="l00211"></a>00211         painter-&gt;drawRect(adj);
<a name="l00212"></a>00212     }
<a name="l00213"></a>00213 
<a name="l00214"></a>00214 
<a name="l00215"></a>00215 }
<a name="l00216"></a>00216 <span class="comment">/* ========================================================================= */</span>
<a name="l00217"></a>00217 
<a name="l00218"></a>00218 <span class="comment">/* ------------------------------------------------------------------------- */</span>
<a name="l00219"></a><a class="code" href="class_e_t_i___cplx_txt.html#a13a4944d4e2b4aeca8f0ea18832bfa63">00219</a> QPainterPath    <a class="code" href="class_e_t_i___cplx_txt.html#a13a4944d4e2b4aeca8f0ea18832bfa63" title="gives the shape of this item">ETI_CplxTxt::shape</a>()<span class="keyword"> const</span>
<a name="l00220"></a>00220 <span class="keyword"></span>{
<a name="l00221"></a>00221     QPainterPath path;
<a name="l00222"></a>00222     path.addRect(<a class="code" href="class_e_t_i___cplx_txt.html#ae9b4ae9249ec73c2b570e601436ad44b" title="defines the outer bounds of the item as a rectangle">boundingRect</a>());
<a name="l00223"></a>00223     <span class="keywordflow">return</span> path;
<a name="l00224"></a>00224 }
<a name="l00225"></a>00225 <span class="comment">/* ========================================================================= */</span>
<a name="l00226"></a>00226 
<a name="l00227"></a>00227 <span class="comment">/* ------------------------------------------------------------------------- */</span>
<a name="l00228"></a><a class="code" href="class_e_t_i___cplx_txt.html#ade528aae64d637b0085a4213230a44ad">00228</a> <span class="keywordtype">bool</span>            <a class="code" href="class_e_t_i___cplx_txt.html#ade528aae64d637b0085a4213230a44ad" title="tell if a point is inside this item">ETI_CplxTxt::contains</a>       (<span class="keyword">const</span> QPointF &amp;point)<span class="keyword"> const</span>
<a name="l00229"></a>00229 <span class="keyword"></span>{
<a name="l00230"></a>00230     <span class="keywordflow">return</span> <a class="code" href="class_e_t_i___cplx_txt.html#ae9b4ae9249ec73c2b570e601436ad44b" title="defines the outer bounds of the item as a rectangle">boundingRect</a>().contains(point);
<a name="l00231"></a>00231 }
<a name="l00232"></a>00232 <span class="comment">/* ========================================================================= */</span>
<a name="l00233"></a>00233 
<a name="l00234"></a>00234 <span class="comment">/* ------------------------------------------------------------------------- */</span>
<a name="l00235"></a><a class="code" href="class_e_t_i___cplx_txt.html#a8f8d213e933bea9a5725b6541a0a347d">00235</a> <span class="keywordtype">bool</span>            <a class="code" href="class_e_t_i___cplx_txt.html#a8f8d213e933bea9a5725b6541a0a347d">ETI_CplxTxt::sceneEvent</a>     (QEvent * event)
<a name="l00236"></a>00236 {
<a name="l00237"></a>00237     QEvent::Type t = <span class="keyword">event</span>-&gt;type();
<a name="l00238"></a>00238     <span class="keywordflow">if</span> (t == QEvent::KeyPress || t == QEvent::KeyRelease)
<a name="l00239"></a>00239     {
<a name="l00240"></a>00240         <span class="keywordtype">int</span> k = ((QKeyEvent *)event)-&gt;key();
<a name="l00241"></a>00241         <span class="comment">//        if (k == Qt::Key_Tab || k == Qt::Key_Backtab) {</span>
<a name="l00242"></a>00242         <span class="comment">//            dd-&gt;sendControlEvent(event);</span>
<a name="l00243"></a>00243         <span class="comment">//            return true;</span>
<a name="l00244"></a>00244         <span class="comment">//        }</span>
<a name="l00245"></a>00245         Q_UNUSED(k);
<a name="l00246"></a>00246     }
<a name="l00247"></a>00247     <span class="keywordtype">bool</span> result = <a class="code" href="class_e_t_i___cplx_txt.html#a8f8d213e933bea9a5725b6541a0a347d">QGraphicsItem::sceneEvent</a>(event);
<a name="l00248"></a>00248 
<a name="l00249"></a>00249     <span class="comment">// Ensure input context is updated.</span>
<a name="l00250"></a>00250     <span class="keywordflow">switch</span> (event-&gt;type()) {
<a name="l00251"></a>00251     <span class="keywordflow">case</span> QEvent::ContextMenu:
<a name="l00252"></a>00252     <span class="keywordflow">case</span> QEvent::FocusIn:
<a name="l00253"></a>00253     <span class="keywordflow">case</span> QEvent::FocusOut:
<a name="l00254"></a>00254     <span class="keywordflow">case</span> QEvent::GraphicsSceneDragEnter:
<a name="l00255"></a>00255     <span class="keywordflow">case</span> QEvent::GraphicsSceneDragLeave:
<a name="l00256"></a>00256     <span class="keywordflow">case</span> QEvent::GraphicsSceneDragMove:
<a name="l00257"></a>00257     <span class="keywordflow">case</span> QEvent::GraphicsSceneDrop:
<a name="l00258"></a>00258     <span class="keywordflow">case</span> QEvent::GraphicsSceneHoverEnter:
<a name="l00259"></a>00259     <span class="keywordflow">case</span> QEvent::GraphicsSceneHoverLeave:
<a name="l00260"></a>00260     <span class="keywordflow">case</span> QEvent::GraphicsSceneHoverMove:
<a name="l00261"></a>00261     <span class="keywordflow">case</span> QEvent::GraphicsSceneMouseDoubleClick:
<a name="l00262"></a>00262     <span class="keywordflow">case</span> QEvent::GraphicsSceneMousePress:
<a name="l00263"></a>00263     <span class="keywordflow">case</span> QEvent::GraphicsSceneMouseMove:
<a name="l00264"></a>00264     <span class="keywordflow">case</span> QEvent::GraphicsSceneMouseRelease:
<a name="l00265"></a>00265     <span class="keywordflow">case</span> QEvent::KeyPress:
<a name="l00266"></a>00266     <span class="keywordflow">case</span> QEvent::KeyRelease:
<a name="l00267"></a>00267         <span class="comment">// Reset the focus widget&#39;s input context, regardless</span>
<a name="l00268"></a>00268         <span class="comment">// of how this item gained or lost focus.</span>
<a name="l00269"></a>00269         <span class="keywordflow">if</span> (QWidget *fw = qApp-&gt;focusWidget()) {
<a name="l00270"></a>00270 <span class="preprocessor">#ifndef QT_NO_IM</span>
<a name="l00271"></a>00271 <span class="preprocessor"></span>            <span class="keywordflow">if</span> (QInputContext *qic = fw-&gt;inputContext()) {
<a name="l00272"></a>00272                 <span class="keywordflow">if</span> (event-&gt;type() == QEvent::FocusIn ||
<a name="l00273"></a>00273                         <span class="keyword">event</span>-&gt;type() == QEvent::FocusOut)
<a name="l00274"></a>00274                     qic-&gt;reset();
<a name="l00275"></a>00275                 <span class="keywordflow">else</span>
<a name="l00276"></a>00276                     qic-&gt;update();
<a name="l00277"></a>00277             }
<a name="l00278"></a>00278 <span class="preprocessor">#endif //QT_NO_IM</span>
<a name="l00279"></a>00279 <span class="preprocessor"></span>        }
<a name="l00280"></a>00280         <span class="keywordflow">break</span>;
<a name="l00281"></a>00281         <span class="comment">//  case QEvent::ShortcutOverride:</span>
<a name="l00282"></a>00282         <span class="comment">//      dd-&gt;sendControlEvent(event);</span>
<a name="l00283"></a>00283         <span class="comment">//      return true;</span>
<a name="l00284"></a>00284     <span class="keywordflow">default</span>:
<a name="l00285"></a>00285         <span class="keywordflow">break</span>;
<a name="l00286"></a>00286     }
<a name="l00287"></a>00287 
<a name="l00288"></a>00288     <span class="keywordflow">return</span> result;
<a name="l00289"></a>00289 }
<a name="l00290"></a>00290 <span class="comment">/* ========================================================================= */</span>
<a name="l00291"></a>00291 
<a name="l00292"></a>00292 <span class="comment">/* ------------------------------------------------------------------------- */</span>
<a name="l00293"></a><a class="code" href="class_e_t_i___cplx_txt.html#a7766fe534a3545eae5855d0d1322291a">00293</a> <span class="keywordtype">void</span>                <a class="code" href="class_e_t_i___cplx_txt.html#a7766fe534a3545eae5855d0d1322291a" title="recompute internal data">ETI_CplxTxt::recompute</a>      (<span class="keywordtype">bool</span> b_full)
<a name="l00294"></a>00294 {
<a name="l00295"></a>00295     <a class="code" href="class_e_t_i___cplx_txt.html#af79d9753f43d28e05915c1bf193f572a" title="the root item">it_r</a>.<a class="code" href="class_e_t_s_i___root.html#a71effe35acf619b8f7e85cfb0e9345cb" title="get the bounding box of this item">recompute</a>(b_full);
<a name="l00296"></a>00296 }
<a name="l00297"></a>00297 <span class="comment">/* ========================================================================= */</span>
<a name="l00298"></a>00298 
<a name="l00299"></a>00299 <span class="comment">/* ------------------------------------------------------------------------- */</span>
<a name="l00300"></a><a class="code" href="class_e_t_i___cplx_txt.html#aeb38a87c67b56c66ab090cbe6bef015e">00300</a> <span class="keywordtype">void</span>                <a class="code" href="class_e_t_i___cplx_txt.html#aeb38a87c67b56c66ab090cbe6bef015e" title="called to determine the sub-item that was hit">ETI_CplxTxt::hitTest</a>        (<a class="code" href="struct_e_t_sub_item_1_1_ht_data.html" title="structure used with the hit test function to pass informations arround">ETSubItem::HtData</a> * h_data)
<a name="l00301"></a>00301 {
<a name="l00302"></a>00302     <span class="keywordflow">if</span> (<a class="code" href="class_e_t_i___cplx_txt.html#af79d9753f43d28e05915c1bf193f572a" title="the root item">it_r</a>.<a class="code" href="class_e_t_sub_item.html#adf58f56e8ceb21c5bdfce3effa09816b" title="the bounding box">boundingBox</a>().contains(h_data-&gt;<a class="code" href="struct_e_t_sub_item_1_1_ht_data.html#a76f2784590b948caeb617c3a0de404ce">ck_pt</a>))
<a name="l00303"></a>00303     {
<a name="l00304"></a>00304         <a class="code" href="class_e_t_i___cplx_txt.html#af79d9753f43d28e05915c1bf193f572a" title="the root item">it_r</a>.<a class="code" href="class_e_t_s_i___root.html#a3a79a9a47c1db21d6903fd5a16a1d34b" title="called to determine the sub-item that was hit">hitTest</a>(h_data);
<a name="l00305"></a>00305     }
<a name="l00306"></a>00306     <span class="keywordflow">else</span>
<a name="l00307"></a>00307         h_data-&gt;<a class="code" href="struct_e_t_sub_item_1_1_ht_data.html#a330abd29a1d408764aa6d5fac7aec598">it_hitted</a> = <a class="code" href="aclass__ddhc_8cc.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>;
<a name="l00308"></a>00308 }
<a name="l00309"></a>00309 <span class="comment">/* ========================================================================= */</span>
<a name="l00310"></a>00310 
<a name="l00311"></a>00311 <span class="comment">/* ------------------------------------------------------------------------- */</span>
<a name="l00312"></a><a class="code" href="class_e_t_i___cplx_txt.html#a243665c86d234497a02800bb3b9b3b89">00312</a> <span class="keywordtype">void</span>                <a class="code" href="class_e_t_i___cplx_txt.html#a243665c86d234497a02800bb3b9b3b89">ETI_CplxTxt::mouseDoubleClickEvent</a> (
<a name="l00313"></a>00313         QGraphicsSceneMouseEvent * event )
<a name="l00314"></a>00314 {
<a name="l00315"></a>00315 
<a name="l00316"></a>00316     <a class="code" href="class_e_t_sheet_view.html" title="Widget capable of displaying an ETSheet content.">ETSheetView</a> * p_vp = <span class="keyword">static_cast&lt;</span><a class="code" href="class_e_t_sheet_view.html" title="Widget capable of displaying an ETSheet content.">ETSheetView</a> *<span class="keyword">&gt;</span>(<span class="keyword">event</span>-&gt;widget()-&gt;parent());
<a name="l00317"></a>00317     <a class="code" href="struct_e_t_sub_item_1_1_ht_data.html" title="structure used with the hit test function to pass informations arround">ETSubItem::HtData</a> h_data(event-&gt;pos());
<a name="l00318"></a>00318     <a class="code" href="class_e_t_i___cplx_txt.html#aeb38a87c67b56c66ab090cbe6bef015e" title="called to determine the sub-item that was hit">hitTest</a>(&amp;h_data);
<a name="l00319"></a>00319     <span class="keywordflow">if</span> (h_data.it_hitted != <a class="code" href="aclass__ddhc_8cc.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>)
<a name="l00320"></a>00320     {
<a name="l00321"></a>00321 
<a name="l00322"></a>00322         <span class="comment">//      QPoint mapped_tl = p_vp-&gt;mapFromScene(</span>
<a name="l00323"></a>00323         <span class="comment">//                  h_data.rct_bbx.x(),</span>
<a name="l00324"></a>00324         <span class="comment">//                  h_data.rct_bbx.y());</span>
<a name="l00325"></a>00325         <span class="comment">//      QPoint mapped_br = p_vp-&gt;mapFromScene(</span>
<a name="l00326"></a>00326         <span class="comment">//                  h_data.rct_bbx.x(),</span>
<a name="l00327"></a>00327         <span class="comment">//                  h_data.rct_bbx.y());</span>
<a name="l00328"></a>00328 
<a name="l00329"></a>00329 
<a name="l00330"></a>00330 
<a name="l00331"></a>00331         <span class="keywordflow">if</span> (h_data.it_hitted-&gt;type() == <a class="code" href="class_e_t_sub_item.html#aa7307b06fe620851acea92b9b6e93ea6ab47ada72a5ab0073c8b32562eb3185d4">ETSubItem::TYSTEXT</a>)
<a name="l00332"></a>00332         {
<a name="l00333"></a>00333             <a class="code" href="class_e_t_vp_cmd___edit_sub_i.html" title="viewport command that edits an sub-item">ETVpCmd_EditSubI</a> * sic = <span class="keyword">new</span> <a class="code" href="class_e_t_vp_cmd___edit_sub_i.html" title="viewport command that edits an sub-item">ETVpCmd_EditSubI</a>();
<a name="l00334"></a>00334             sic-&gt;<a class="code" href="class_e_t_vp_cmd___edit_sub_i.html#aa70566ffebd1ca876d2eca56172c73c7" title="called before start() to set the item that&#39;s being edited">setSubItemToEdit</a>(
<a name="l00335"></a>00335                         <span class="keyword">this</span>,
<a name="l00336"></a>00336                         static_cast&lt;ETSI_SText *&gt;
<a name="l00337"></a>00337                         (h_data.it_hitted));
<a name="l00338"></a>00338             p_vp-&gt;<a class="code" href="class_e_t_sheet_view.html#aede56f48bf9600e59e3a58e1af33fc0c" title="starts a command; will cancel previous command if running">startCommand</a>(sic);
<a name="l00339"></a>00339         }
<a name="l00340"></a>00340 
<a name="l00341"></a>00341 
<a name="l00342"></a>00342 
<a name="l00343"></a>00343     }
<a name="l00344"></a>00344     <span class="keyword">event</span>-&gt;accept();
<a name="l00345"></a>00345 }
<a name="l00346"></a>00346 <span class="comment">/* ========================================================================= */</span>
<a name="l00347"></a>00347 
<a name="l00348"></a>00348 <span class="comment">/* ------------------------------------------------------------------------- */</span>
<a name="l00349"></a><a class="code" href="class_e_t_i___cplx_txt.html#aafa2d148ab009cd8af43ab254ccca647">00349</a> <span class="keywordtype">void</span>                <a class="code" href="class_e_t_i___cplx_txt.html#aafa2d148ab009cd8af43ab254ccca647" title="recives a point and acts as response of a mouse click">ETI_CplxTxt::performClick</a>   (<a class="code" href="class_e_t_sheet_view.html" title="Widget capable of displaying an ETSheet content.">ETSheetView</a> * p_vp, QPointF pt)
<a name="l00350"></a>00350 {
<a name="l00351"></a>00351     <a class="code" href="struct_e_t_sub_item_1_1_ht_data.html" title="structure used with the hit test function to pass informations arround">ETSubItem::HtData</a> h_data(pt);
<a name="l00352"></a>00352     <a class="code" href="class_e_t_i___cplx_txt.html#aeb38a87c67b56c66ab090cbe6bef015e" title="called to determine the sub-item that was hit">hitTest</a>(&amp;h_data);
<a name="l00353"></a>00353     <span class="keywordflow">if</span> (h_data.<a class="code" href="struct_e_t_sub_item_1_1_ht_data.html#a330abd29a1d408764aa6d5fac7aec598">it_hitted</a> != <a class="code" href="aclass__ddhc_8cc.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>)
<a name="l00354"></a>00354     {
<a name="l00355"></a>00355         <span class="keywordflow">if</span> (h_data.<a class="code" href="struct_e_t_sub_item_1_1_ht_data.html#a76f2784590b948caeb617c3a0de404ce">ck_pt</a>.x() - h_data.<a class="code" href="struct_e_t_sub_item_1_1_ht_data.html#a25d07d87b54fde164a9ceab1fc23498a">rct_bbx</a>.x() &gt; h_data.<a class="code" href="struct_e_t_sub_item_1_1_ht_data.html#a25d07d87b54fde164a9ceab1fc23498a">rct_bbx</a>.width() / 2 )
<a name="l00356"></a>00356         {
<a name="l00357"></a>00357             p_vp-&gt;<a class="code" href="class_e_t_sheet_view.html#ae87a30f64df86317740a116b0af322f0" title="informs the viewport that the selection is on the right side">setSelRight</a>();
<a name="l00358"></a>00358         }
<a name="l00359"></a>00359         <span class="keywordflow">else</span>
<a name="l00360"></a>00360         {
<a name="l00361"></a>00361             p_vp-&gt;<a class="code" href="class_e_t_sheet_view.html#a66c17e719116958234212c3a82310300" title="informs the viewport that the selection is on the left side">setSelLeft</a>();
<a name="l00362"></a>00362         }
<a name="l00363"></a>00363         p_vp-&gt;<a class="code" href="class_e_t_sheet_view.html#ae2acde853ced4e5b49913cc048fa5abc" title="inform the view that a new current item was decided">setCurrentSubI</a>(<span class="keyword">this</span>, h_data.<a class="code" href="struct_e_t_sub_item_1_1_ht_data.html#a330abd29a1d408764aa6d5fac7aec598">it_hitted</a>);
<a name="l00364"></a>00364         update();
<a name="l00365"></a>00365     }
<a name="l00366"></a>00366 
<a name="l00367"></a>00367 }
<a name="l00368"></a>00368 <span class="comment">/* ========================================================================= */</span>
<a name="l00369"></a>00369 
<a name="l00370"></a>00370 <span class="comment">/* ------------------------------------------------------------------------- */</span>
<a name="l00371"></a><a class="code" href="class_e_t_i___cplx_txt.html#ad04b58cc4cd9aa38f977b5dcfecec9eb">00371</a> <span class="keywordtype">void</span>                <a class="code" href="class_e_t_i___cplx_txt.html#ad04b58cc4cd9aa38f977b5dcfecec9eb">ETI_CplxTxt::mousePressEvent</a>        (
<a name="l00372"></a>00372         QGraphicsSceneMouseEvent *event)
<a name="l00373"></a>00373 {
<a name="l00374"></a>00374     <a class="code" href="class_e_t_i___cplx_txt.html#aafa2d148ab009cd8af43ab254ccca647" title="recives a point and acts as response of a mouse click">performClick</a>(
<a name="l00375"></a>00375                 static_cast&lt;ETSheetView *&gt;(event-&gt;widget()-&gt;parent()),
<a name="l00376"></a>00376                 event-&gt;pos()
<a name="l00377"></a>00377                 );
<a name="l00378"></a>00378 
<a name="l00379"></a>00379     <a class="code" href="class_e_t_i___cplx_txt.html#ad04b58cc4cd9aa38f977b5dcfecec9eb">QGraphicsItem::mousePressEvent</a>(event);
<a name="l00380"></a>00380 
<a name="l00381"></a>00381 }
<a name="l00382"></a>00382 <span class="comment">/* ========================================================================= */</span>
<a name="l00383"></a>00383 
<a name="l00384"></a>00384 <span class="comment">/* ------------------------------------------------------------------------- */</span>
<a name="l00385"></a><a class="code" href="class_e_t_i___cplx_txt.html#a98a8e2fea4fdc4b2b917b6c8c084f49a">00385</a> <span class="keywordtype">void</span>                <a class="code" href="class_e_t_i___cplx_txt.html#a98a8e2fea4fdc4b2b917b6c8c084f49a">ETI_CplxTxt::mouseMoveEvent</a>         (
<a name="l00386"></a>00386         QGraphicsSceneMouseEvent *event)
<a name="l00387"></a>00387 {
<a name="l00388"></a>00388 
<a name="l00389"></a>00389     <span class="comment">//  ETSubItem::HtData h_data(event-&gt;pos());</span>
<a name="l00390"></a>00390     <span class="comment">//  hitTest(&amp;h_data);</span>
<a name="l00391"></a>00391     <span class="comment">//  if (h_data.it_hitted != NULL)</span>
<a name="l00392"></a>00392     <span class="comment">//      {</span>
<a name="l00393"></a>00393 
<a name="l00394"></a>00394     <span class="comment">//          /// @todo do sth with resulted item</span>
<a name="l00395"></a>00395     <span class="comment">//      }</span>
<a name="l00396"></a>00396 
<a name="l00397"></a>00397     <span class="comment">//  event-&gt;accept();</span>
<a name="l00398"></a>00398     <a class="code" href="class_e_t_i___cplx_txt.html#a98a8e2fea4fdc4b2b917b6c8c084f49a">QGraphicsItem::mouseMoveEvent</a>(event);
<a name="l00399"></a>00399 
<a name="l00400"></a>00400 }
<a name="l00401"></a>00401 <span class="comment">/* ========================================================================= */</span>
<a name="l00402"></a>00402 
<a name="l00403"></a>00403 <span class="comment">/* ------------------------------------------------------------------------- */</span>
<a name="l00404"></a><a class="code" href="class_e_t_i___cplx_txt.html#a8b8b97bd6a712e81ff5c0d2dc7d1d33a">00404</a> <span class="keywordtype">void</span>                <a class="code" href="class_e_t_i___cplx_txt.html#a8b8b97bd6a712e81ff5c0d2dc7d1d33a">ETI_CplxTxt::mouseReleaseEvent</a>      (
<a name="l00405"></a>00405         QGraphicsSceneMouseEvent *event)
<a name="l00406"></a>00406 {
<a name="l00407"></a>00407 
<a name="l00408"></a>00408     <span class="comment">//  ETSubItem::HtData h_data(event-&gt;pos());</span>
<a name="l00409"></a>00409     <span class="comment">//  hitTest(&amp;h_data);</span>
<a name="l00410"></a>00410     <span class="comment">//  if (h_data.it_hitted != NULL)</span>
<a name="l00411"></a>00411     <span class="comment">//      {</span>
<a name="l00412"></a>00412 
<a name="l00413"></a>00413     <span class="comment">//          /// @todo do sth with resulted item</span>
<a name="l00414"></a>00414     <span class="comment">//      }</span>
<a name="l00415"></a>00415     <a class="code" href="class_e_t_i___cplx_txt.html#a8b8b97bd6a712e81ff5c0d2dc7d1d33a">QGraphicsItem::mouseReleaseEvent</a>(event);
<a name="l00416"></a>00416 
<a name="l00417"></a>00417 
<a name="l00418"></a>00418 }
<a name="l00419"></a>00419 <span class="comment">/* ========================================================================= */</span>
<a name="l00420"></a>00420 
<a name="l00421"></a>00421 <span class="comment">/* ------------------------------------------------------------------------- */</span>
<a name="l00422"></a><a class="code" href="class_e_t_i___cplx_txt.html#a93cfa4c2a45155377722fe96ef2bc605">00422</a> <span class="keywordtype">void</span>                <a class="code" href="class_e_t_i___cplx_txt.html#a93cfa4c2a45155377722fe96ef2bc605">ETI_CplxTxt::contextMenuEvent</a>       (
<a name="l00423"></a>00423         QGraphicsSceneContextMenuEvent *event)
<a name="l00424"></a>00424 {
<a name="l00425"></a>00425 
<a name="l00426"></a>00426     <a class="code" href="struct_e_t_sub_item_1_1_ht_data.html" title="structure used with the hit test function to pass informations arround">ETSubItem::HtData</a> h_data(event-&gt;pos());
<a name="l00427"></a>00427     <a class="code" href="class_e_t_i___cplx_txt.html#aeb38a87c67b56c66ab090cbe6bef015e" title="called to determine the sub-item that was hit">hitTest</a>(&amp;h_data);
<a name="l00428"></a>00428     <span class="keywordflow">if</span> (h_data.it_hitted != <a class="code" href="aclass__ddhc_8cc.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>)
<a name="l00429"></a>00429     {
<a name="l00430"></a>00430 <span class="comment"></span>
<a name="l00431"></a>00431 <span class="comment">        /// @todo do sth with resulted item</span>
<a name="l00432"></a>00432 <span class="comment"></span>    }
<a name="l00433"></a>00433 
<a name="l00434"></a>00434     <span class="comment">//QGraphicsItem::contextMenuEvent(event);</span>
<a name="l00435"></a>00435     <span class="keyword">event</span>-&gt;accept();
<a name="l00436"></a>00436 }
<a name="l00437"></a>00437 <span class="comment">/* ========================================================================= */</span>
<a name="l00438"></a>00438 
<a name="l00439"></a>00439 
<a name="l00440"></a>00440 <span class="comment">/* ------------------------------------------------------------------------- */</span>
<a name="l00441"></a><a class="code" href="class_e_t_i___cplx_txt.html#a90619dcc080b4d3e2bf7e1d3056a8073">00441</a> <span class="keywordtype">void</span>                <a class="code" href="class_e_t_i___cplx_txt.html#a90619dcc080b4d3e2bf7e1d3056a8073" title="the item is cleared and brought to a state just like after creation">ETI_CplxTxt::reinit</a>             ( <span class="keywordtype">bool</span> b_recomp )
<a name="l00442"></a>00442 {<span class="comment"></span>
<a name="l00443"></a>00443 <span class="comment">    /// @todo replace the delete with a proper undo method</span>
<a name="l00444"></a>00444 <span class="comment"></span>    <a class="code" href="main_8h.html#a2fb92e95e9bd37461409b33016829761">LIST_BUG</a> <span class="keyword">this</span> &lt;&lt; <span class="stringliteral">&quot; root : &quot;</span>;
<a name="l00445"></a>00445     <a class="code" href="class_e_t_i___cplx_txt.html#af79d9753f43d28e05915c1bf193f572a" title="the root item">it_r</a>.<a class="code" href="class_e_t_s_i___root.html#aee724804473325145496676ee3d99698" title="dump this object">dumpDbg2</a>();
<a name="l00446"></a>00446 
<a name="l00447"></a>00447     <a class="code" href="class_e_t_i___cplx_txt.html#af79d9753f43d28e05915c1bf193f572a" title="the root item">it_r</a>.<a class="code" href="class_e_t_s_i___root.html#af2f1059c9cec39cfdc9c112816eac513" title="remove all items from this list by deleting them">erase</a>();
<a name="l00448"></a>00448     <a class="code" href="main_8h.html#a2fb92e95e9bd37461409b33016829761">LIST_BUG</a> <span class="keyword">this</span> &lt;&lt; <span class="stringliteral">&quot; root : &quot;</span>;
<a name="l00449"></a>00449     <a class="code" href="class_e_t_i___cplx_txt.html#af79d9753f43d28e05915c1bf193f572a" title="the root item">it_r</a>.<a class="code" href="class_e_t_s_i___root.html#aee724804473325145496676ee3d99698" title="dump this object">dumpDbg2</a>();
<a name="l00450"></a>00450 
<a name="l00451"></a>00451     <a class="code" href="class_e_t_s_i___s_text.html" title="simple sub-item capable to display a string">ETSI_SText</a> * only_it = <span class="keyword">new</span> <a class="code" href="class_e_t_s_i___s_text.html" title="simple sub-item capable to display a string">ETSI_SText</a>();
<a name="l00452"></a>00452     <a class="code" href="class_e_t_i___cplx_txt.html#af79d9753f43d28e05915c1bf193f572a" title="the root item">it_r</a>.<a class="code" href="class_e_t_s_i___root.html#a0a62cd333fa4d577087d3dbe144eba6a" title="append an item (insert after last)">append</a>(only_it);
<a name="l00453"></a>00453     <a class="code" href="class_e_t_i___cplx_txt.html#af79d9753f43d28e05915c1bf193f572a" title="the root item">it_r</a>.<a class="code" href="class_e_t_sub_item.html#ab162bc8bf3933ee501bcbc599b6a40f6" title="marks this item and all it&#39;s parents as being required to be recomputed">setSizeDirty</a>(<a class="code" href="aclass__ddhc_8cc.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>);
<a name="l00454"></a>00454     <a class="code" href="main_8h.html#a2fb92e95e9bd37461409b33016829761">LIST_BUG</a> only_it &lt;&lt; <span class="stringliteral">&quot; appended: &quot;</span> ;
<a name="l00455"></a>00455     <a class="code" href="main_8h.html#a2fb92e95e9bd37461409b33016829761">LIST_BUG</a> <span class="keyword">this</span> &lt;&lt; <span class="stringliteral">&quot; after append root : &quot;</span>;
<a name="l00456"></a>00456     <a class="code" href="class_e_t_i___cplx_txt.html#af79d9753f43d28e05915c1bf193f572a" title="the root item">it_r</a>.<a class="code" href="class_e_t_s_i___root.html#aee724804473325145496676ee3d99698" title="dump this object">dumpDbg2</a>();
<a name="l00457"></a>00457 
<a name="l00458"></a>00458     <span class="keywordflow">if</span> (b_recomp)
<a name="l00459"></a>00459     {
<a name="l00460"></a>00460         <a class="code" href="class_e_t_i___cplx_txt.html#a7766fe534a3545eae5855d0d1322291a" title="recompute internal data">recompute</a>(<span class="keyword">true</span>);
<a name="l00461"></a>00461     }
<a name="l00462"></a>00462 
<a name="l00463"></a>00463     <a class="code" href="main_8h.html#a2fb92e95e9bd37461409b33016829761">LIST_BUG</a> <span class="keyword">this</span> &lt;&lt; <span class="stringliteral">&quot; on exit root : &quot;</span>;
<a name="l00464"></a>00464     <a class="code" href="class_e_t_i___cplx_txt.html#af79d9753f43d28e05915c1bf193f572a" title="the root item">it_r</a>.<a class="code" href="class_e_t_s_i___root.html#aee724804473325145496676ee3d99698" title="dump this object">dumpDbg2</a>();
<a name="l00465"></a>00465 }
<a name="l00466"></a>00466 <span class="comment">/* ========================================================================= */</span>
<a name="l00467"></a>00467 
<a name="l00468"></a>00468 <span class="comment">/* ------------------------------------------------------------------------- */</span>
<a name="l00469"></a><a class="code" href="class_e_t_i___cplx_txt.html#af76d85272795dbc058c8e9ccf3395b6e">00469</a> <a class="code" href="class_e_t_i___cplx_txt.html" title="class representing a complex text; this may or may not represent an equation">ETI_CplxTxt</a> *       <a class="code" href="class_e_t_i___cplx_txt.html#af76d85272795dbc058c8e9ccf3395b6e" title="creates an viewport in specified sheet based on DOM node">ETI_CplxTxt::loadXML</a>            (
<a name="l00470"></a>00470         <a class="code" href="class_e_t_sheet.html" title="Class representing logical root for all elements contained in a document (sheet)">ETSheet</a> * dest, QDomElement dom_e)
<a name="l00471"></a>00471 {
<a name="l00472"></a>00472     QDomElement dom_it;
<a name="l00473"></a>00473     QDomElement dom_sit;
<a name="l00474"></a>00474     <a class="code" href="class_e_t_i___cplx_txt.html" title="class representing a complex text; this may or may not represent an equation">ETI_CplxTxt</a> * ret_it = <span class="keyword">new</span> <a class="code" href="class_e_t_i___cplx_txt.html#aebbd17a8b2444b1a4a29c422a1fa85ad" title="internal constructor used by loadXML() to create the new instance">ETI_CplxTxt</a>() ;
<a name="l00475"></a>00475 
<a name="l00476"></a>00476     <span class="comment">/* common properties for all items inheriting from */</span>
<a name="l00477"></a>00477     dom_it = dom_e.firstChildElement(<a class="code" href="_e_t_sheet_8h.html#abf48751c40205f6cacc85875239a5036">XML_TAG_COMM</a>);
<a name="l00478"></a>00478     <span class="keywordflow">if</span> (!dom_it.isNull())
<a name="l00479"></a>00479     {
<a name="l00480"></a>00480         <a class="code" href="class_e_t_sheet.html#a290549c5a6aba1b5f1f9c5dd8da1584f" title="load common properties of a QGraphicsItem from a dox node">ETSheet::loadQICommon</a>(ret_it, dom_it);
<a name="l00481"></a>00481 
<a name="l00482"></a>00482         <span class="keywordflow">if</span> (!dom_it.nextSiblingElement(<a class="code" href="_e_t_sheet_8h.html#abf48751c40205f6cacc85875239a5036">XML_TAG_COMM</a>).isNull())
<a name="l00483"></a>00483         {
<a name="l00484"></a>00484             qDebug() &lt;&lt; <span class="stringliteral">&quot;The input presented more than one &quot;</span>
<a name="l00485"></a>00485                      &lt;&lt; <span class="stringliteral">&quot;common tags, when only one per ETI_CplxTxt element &quot;</span>
<a name="l00486"></a>00486                      &lt;&lt; <span class="stringliteral">&quot;is allowed&quot;</span>;
<a name="l00487"></a>00487         }
<a name="l00488"></a>00488     }
<a name="l00489"></a>00489 
<a name="l00490"></a>00490     <span class="comment">/* the one and only sub-items that has to be of root type */</span>
<a name="l00491"></a>00491     dom_it = dom_e.firstChildElement(<a class="code" href="_e_t_sheet_8h.html#a169dcb43317577b47bb53d007029b957">XML_TAG_SUBITEM</a>);
<a name="l00492"></a>00492     <span class="keywordflow">if</span> (!dom_it.isNull())
<a name="l00493"></a>00493     {
<a name="l00494"></a>00494         dom_sit = dom_it.firstChildElement(<a class="code" href="_e_t_sheet_8h.html#afe714690ff664710e0dfea992dedb48a">XML_TAG_TYPE</a>);
<a name="l00495"></a>00495         <span class="keywordflow">if</span> (!dom_sit.isNull())
<a name="l00496"></a>00496         { <span class="comment">/* silently ignore the lack of type and assume root */</span>
<a name="l00497"></a>00497 
<a name="l00498"></a>00498             <span class="keywordflow">if</span> (dom_sit.text() != <a class="code" href="_e_t_sheet_8h.html#a60d1bd520c61614f6fb52c21323cffd5">XML_SIT_ROOT</a>)
<a name="l00499"></a>00499             {
<a name="l00500"></a>00500 
<a name="l00501"></a>00501                 qDebug() &lt;&lt; <span class="stringliteral">&quot;The input presented an sub-item that &quot;</span>
<a name="l00502"></a>00502                          &lt;&lt; <span class="stringliteral">&quot;was not of root type. Top level &quot;</span>
<a name="l00503"></a>00503                          &lt;&lt; <span class="stringliteral">&quot;sub-item in a ETI_CplxTxt needs to be &quot;</span>
<a name="l00504"></a>00504                          &lt;&lt; <span class="stringliteral">&quot;of root type. Period.&quot;</span>;
<a name="l00505"></a>00505                 <span class="keyword">delete</span> ret_it;
<a name="l00506"></a>00506                 <span class="keywordflow">return</span> <a class="code" href="aclass__ddhc_8cc.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>;
<a name="l00507"></a>00507 
<a name="l00508"></a>00508             }
<a name="l00509"></a>00509         }
<a name="l00510"></a>00510         <span class="comment">/* this call will load entire chain of sub-items */</span>
<a name="l00511"></a>00511         <a class="code" href="class_e_t_i___cplx_txt.html#af76d85272795dbc058c8e9ccf3395b6e" title="creates an viewport in specified sheet based on DOM node">ETSI_Root::loadXML</a>(dom_it, &amp;ret_it-&gt;<a class="code" href="class_e_t_i___cplx_txt.html#af79d9753f43d28e05915c1bf193f572a" title="the root item">it_r</a>);
<a name="l00512"></a>00512 
<a name="l00513"></a>00513         <span class="keywordflow">if</span> (!dom_it.nextSiblingElement(<a class="code" href="_e_t_sheet_8h.html#a169dcb43317577b47bb53d007029b957">XML_TAG_SUBITEM</a>).isNull())
<a name="l00514"></a>00514         {
<a name="l00515"></a>00515             qDebug() &lt;&lt; <span class="stringliteral">&quot;The input presented more than one &quot;</span>
<a name="l00516"></a>00516                      &lt;&lt; <span class="stringliteral">&quot;top level sub-items, when only one per ETI_CplxTxt element &quot;</span>
<a name="l00517"></a>00517                      &lt;&lt; <span class="stringliteral">&quot;is allowed&quot;</span>;
<a name="l00518"></a>00518         }
<a name="l00519"></a>00519     }
<a name="l00520"></a>00520 
<a name="l00521"></a>00521     <span class="comment">/* get the bounding boxes for all items */</span>
<a name="l00522"></a>00522     ret_it-&gt;<a class="code" href="class_e_t_i___cplx_txt.html#a7766fe534a3545eae5855d0d1322291a" title="recompute internal data">recompute</a>(<span class="keyword">true</span>);
<a name="l00523"></a>00523 
<a name="l00524"></a>00524     <span class="comment">/* and insert it in the sheet */</span>
<a name="l00525"></a>00525     dest-&gt;addItem(ret_it);
<a name="l00526"></a>00526 
<a name="l00527"></a>00527     <span class="keywordflow">return</span> ret_it;
<a name="l00528"></a>00528 }
<a name="l00529"></a>00529 <span class="comment">/* ========================================================================= */</span>
<a name="l00530"></a>00530 
<a name="l00531"></a>00531 <span class="comment">/* ------------------------------------------------------------------------- */</span>
<a name="l00532"></a><a class="code" href="class_e_t_i___cplx_txt.html#a82b0bceeb2d7fb2b793138a2cd52b52c">00532</a> <span class="keywordtype">void</span>        <a class="code" href="class_e_t_i___cplx_txt.html#a82b0bceeb2d7fb2b793138a2cd52b52c" title="saves the item in provided DOM element">ETI_CplxTxt::saveXML</a>            (
<a name="l00533"></a>00533         QDomElement dom_e)
<a name="l00534"></a>00534 {
<a name="l00535"></a>00535 
<a name="l00536"></a>00536     <span class="comment">/* save common data */</span>
<a name="l00537"></a>00537     QDomElement dom_it = dom_e.ownerDocument().createElement(<a class="code" href="_e_t_sheet_8h.html#abf48751c40205f6cacc85875239a5036">XML_TAG_COMM</a>);
<a name="l00538"></a>00538     dom_e.appendChild(dom_it);
<a name="l00539"></a>00539     <a class="code" href="class_e_t_sheet.html#ab66f954ab58258d7eae54feb21081c16" title="save common properties of a QGraphicsItem from a dox node">ETSheet::saveQICommon</a>(<span class="keyword">this</span>, dom_it);
<a name="l00540"></a>00540 
<a name="l00541"></a>00541     <span class="comment">/* the root item (will tigger a full save) */</span>
<a name="l00542"></a>00542     dom_it = dom_e.ownerDocument().createElement(<a class="code" href="_e_t_sheet_8h.html#a169dcb43317577b47bb53d007029b957">XML_TAG_SUBITEM</a>);
<a name="l00543"></a>00543     dom_e.appendChild(dom_it);
<a name="l00544"></a>00544     <a class="code" href="class_e_t_i___cplx_txt.html#af79d9753f43d28e05915c1bf193f572a" title="the root item">it_r</a>.<a class="code" href="class_e_t_s_i___root.html#ae05de43754afe767abbad50dda047448" title="saves the properties of this item to provided DOM element">saveXML</a>(dom_it);
<a name="l00545"></a>00545 
<a name="l00546"></a>00546 }
<a name="l00547"></a>00547 <span class="comment">/* ========================================================================== */</span>
<a name="l00548"></a>00548 
<a name="l00549"></a>00549 <span class="comment">/* ------------------------------------------------------------------------- */</span>
<a name="l00550"></a><a class="code" href="class_e_t_i___cplx_txt.html#ad23a61a3f97aacb659478d09db0a4ebf">00550</a> <a class="code" href="class_e_t_i___cplx_txt.html" title="class representing a complex text; this may or may not represent an equation">ETI_CplxTxt</a> *   <a class="code" href="class_e_t_i___cplx_txt.html#ad23a61a3f97aacb659478d09db0a4ebf" title="creates a new item containing specified type of sub-item">ETI_CplxTxt::createHost</a> (
<a name="l00551"></a>00551         <a class="code" href="class_e_t_sheet.html" title="Class representing logical root for all elements contained in a document (sheet)">ETSheet</a> * dest, QPointF pos, <a class="code" href="class_e_t_sub_item.html#aa7307b06fe620851acea92b9b6e93ea6" title="enumeration that tells the types of sub-items we know about">ETSubItem::SIType</a> sit_ty )
<a name="l00552"></a>00552 {
<a name="l00553"></a>00553 
<a name="l00554"></a>00554     <a class="code" href="class_e_t_i___cplx_txt.html" title="class representing a complex text; this may or may not represent an equation">ETI_CplxTxt</a> * ret_it = <span class="keyword">new</span> <a class="code" href="class_e_t_i___cplx_txt.html#aebbd17a8b2444b1a4a29c422a1fa85ad" title="internal constructor used by loadXML() to create the new instance">ETI_CplxTxt</a>();
<a name="l00555"></a>00555     <a class="code" href="class_e_t_sub_item.html" title="class representing the common interface exposed by all sub-items of a ETI_CplxTxt">ETSubItem</a> * new_si = <a class="code" href="aclass__ddhc_8cc.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>;
<a name="l00556"></a>00556 <span class="comment"></span>
<a name="l00557"></a>00557 <span class="comment">    /// @todo add code to create sub-item types as they get defined</span>
<a name="l00558"></a>00558 <span class="comment"></span>
<a name="l00559"></a>00559     <span class="keywordflow">switch</span>  (sit_ty)        {
<a name="l00560"></a>00560     <span class="keywordflow">case</span>    <a class="code" href="class_e_t_sub_item.html#aa7307b06fe620851acea92b9b6e93ea6a93042d919022ac6527bfbf4d263d1273">ETSubItem::TYFRACT</a>:     {
<a name="l00561"></a>00561         <a class="code" href="class_e_t_s_i___fract.html" title="sub-item displaying a fraction; consists of two ETSI_Root sub-items">ETSI_Fract</a> * only_it = <span class="keyword">new</span> <a class="code" href="class_e_t_s_i___fract.html" title="sub-item displaying a fraction; consists of two ETSI_Root sub-items">ETSI_Fract</a>();
<a name="l00562"></a>00562         new_si = <span class="keyword">static_cast&lt;</span><a class="code" href="class_e_t_sub_item.html" title="class representing the common interface exposed by all sub-items of a ETI_CplxTxt">ETSubItem</a> *<span class="keyword">&gt;</span>(only_it);
<a name="l00563"></a>00563         <span class="keywordflow">break</span>; }
<a name="l00564"></a>00564         <span class="comment">//  case    ETSubItem::TYHTEXT:     {</span>
<a name="l00565"></a>00565         <span class="comment">//      ETSI_HText * only_it = new ETSI_HText();</span>
<a name="l00566"></a>00566         <span class="comment">//      new_si = static_cast&lt;ETSubItem *&gt;(only_it);</span>
<a name="l00567"></a>00567         <span class="comment">//      break; }</span>
<a name="l00568"></a>00568         <span class="comment">//  case    ETSubItem::TYINTEG:     {</span>
<a name="l00569"></a>00569         <span class="comment">//      ETSI_Integ * only_it = new ETSI_Integ();</span>
<a name="l00570"></a>00570         <span class="comment">//      new_si = static_cast&lt;ETSubItem *&gt;(only_it);</span>
<a name="l00571"></a>00571         <span class="comment">//      break; }</span>
<a name="l00572"></a>00572         <span class="comment">//  case    ETSubItem::TYLIM:       {</span>
<a name="l00573"></a>00573         <span class="comment">//      ETSI_Lim * only_it = new ETSI_Lim();</span>
<a name="l00574"></a>00574         <span class="comment">//      new_si = static_cast&lt;ETSubItem *&gt;(only_it);</span>
<a name="l00575"></a>00575         <span class="comment">//      break; }</span>
<a name="l00576"></a>00576         <span class="comment">//  case    ETSubItem::TYLOGICAC:   {</span>
<a name="l00577"></a>00577         <span class="comment">//      ETSI_LogicAc * only_it = new ETSI_LogicAc();</span>
<a name="l00578"></a>00578         <span class="comment">//      new_si = static_cast&lt;ETSubItem *&gt;(only_it);</span>
<a name="l00579"></a>00579         <span class="comment">//      break; }</span>
<a name="l00580"></a>00580         <span class="comment">//  case    ETSubItem::TYMATRIX:    {</span>
<a name="l00581"></a>00581         <span class="comment">//      ETSI_Matrix * only_it = new ETSI_Matrix();</span>
<a name="l00582"></a>00582         <span class="comment">//      new_si = static_cast&lt;ETSubItem *&gt;(only_it);</span>
<a name="l00583"></a>00583         <span class="comment">//      break; }</span>
<a name="l00584"></a>00584         <span class="comment">//  case    ETSubItem::TYRADIC:     {</span>
<a name="l00585"></a>00585         <span class="comment">//      ETSI_Radic * only_it = new ETSI_Radic();</span>
<a name="l00586"></a>00586         <span class="comment">//      new_si = static_cast&lt;ETSubItem *&gt;(only_it);</span>
<a name="l00587"></a>00587         <span class="comment">//      break; }</span>
<a name="l00588"></a>00588         <span class="comment">//  case    ETSubItem::TYSUM:       {</span>
<a name="l00589"></a>00589         <span class="comment">//      ETSI_Sum * only_it = new ETSI_Sum();</span>
<a name="l00590"></a>00590         <span class="comment">//      new_si = static_cast&lt;ETSubItem *&gt;(only_it);</span>
<a name="l00591"></a>00591         <span class="comment">//      break; }</span>
<a name="l00592"></a>00592     <span class="keywordflow">default</span>:<span class="comment">/* TYROOT TYSTEXT TYMAX errors */</span>   {
<a name="l00593"></a>00593         <a class="code" href="class_e_t_s_i___s_text.html" title="simple sub-item capable to display a string">ETSI_SText</a> * only_it = <span class="keyword">new</span> <a class="code" href="class_e_t_s_i___s_text.html" title="simple sub-item capable to display a string">ETSI_SText</a>();
<a name="l00594"></a>00594         new_si = <span class="keyword">static_cast&lt;</span><a class="code" href="class_e_t_sub_item.html" title="class representing the common interface exposed by all sub-items of a ETI_CplxTxt">ETSubItem</a> *<span class="keyword">&gt;</span>(only_it);
<a name="l00595"></a>00595         <span class="keywordflow">break</span>; }
<a name="l00596"></a>00596     }
<a name="l00597"></a>00597 
<a name="l00598"></a>00598 
<a name="l00599"></a>00599     <span class="comment">/* append this newly created sub-item to the chain */</span>
<a name="l00600"></a>00600     ret_it-&gt;<a class="code" href="class_e_t_i___cplx_txt.html#af79d9753f43d28e05915c1bf193f572a" title="the root item">it_r</a>.<a class="code" href="class_e_t_s_i___root.html#a0a62cd333fa4d577087d3dbe144eba6a" title="append an item (insert after last)">append</a>(new_si);
<a name="l00601"></a>00601 
<a name="l00602"></a>00602 
<a name="l00603"></a>00603     <span class="comment">/* get the bounding boxes for item */</span>
<a name="l00604"></a>00604     ret_it-&gt;<a class="code" href="class_e_t_i___cplx_txt.html#a7766fe534a3545eae5855d0d1322291a" title="recompute internal data">recompute</a>(<span class="keyword">true</span>);
<a name="l00605"></a>00605 
<a name="l00606"></a>00606     <span class="comment">/* and insert it in the sheet */</span>
<a name="l00607"></a>00607     dest-&gt;addItem(ret_it);
<a name="l00608"></a>00608     ret_it-&gt;setPos(pos);
<a name="l00609"></a>00609 
<a name="l00610"></a>00610     <span class="keywordflow">return</span> ret_it;
<a name="l00611"></a>00611 }
<a name="l00612"></a>00612 <span class="comment">/* ========================================================================= */</span>
<a name="l00613"></a>00613 
<a name="l00614"></a>00614 
<a name="l00615"></a>00615 
<a name="l00616"></a>00616 <span class="comment">/*  CLASS    =============================================================== */</span>
<a name="l00617"></a>00617 <span class="comment">//</span>
<a name="l00618"></a>00618 <span class="comment">//</span>
<a name="l00619"></a>00619 <span class="comment">//</span>
<a name="l00620"></a>00620 <span class="comment">//</span>
<a name="l00621"></a>00621 <span class="comment">/* ------------------------------------------------------------------------- */</span>
<a name="l00622"></a>00622 <span class="comment">/* ========================================================================= */</span>
</pre></div></div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="_e_t_i___cplx_txt_8cc.html">ETI_CplxTxt.cc</a>      </li>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

    <li class="footer">Generated on Sun Oct 23 2011 22:06:47 for EquTemper by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </li>
   </ul>
 </div>
</body>
</html>
